<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" type="text/css" th:href="@{/js/plugins/layui-v2.6.8/layui/css/layui.css}">
</head>
<body>

<form class="layui-form" style="padding: 20px;">
    <div class="layui-form-item">
        <div class="layui-row layui-col-xs12">为了提高导入效率，您可以可以这样操作：</div>
        <div class="layui-row layui-col-xs12">1、先导出动物信息excel表格</div>
        <div class="layui-row layui-col-xs12">2、在导出的表格中填写RFID号码、激光号码</div>
        <div class="layui-row layui-col-xs12">3、填写RFID编号、激光号,再导入原始文件。</div>
    </div>
    <div class="layui-form-item">
        <button id="choose" type="button" class="layui-btn" lay-submit lay-filter="formDemo">选择文件</button>
    </div>
    <div>
        <button id="upload" type="button" class="layui-btn layui-btn-normal">开始上传</button>
    </div>
</form>

<script th:src="@{/js/plugins/layui-v2.6.8/layui/layui.js}" type="text/javascript" charset="utf-8"></script>
<script th:src="@{/js/plugins/echarts/echarts.common.min.js}" type="text/javascript" charset="utf-8"></script>
<script th:src="@{/js/banner/banner.js}" type="text/javascript" charset="utf-8"></script>
<!--<script th:src="@{/js/jquery.min.js?v=2.1.4}"></script>-->
<script th:src="@{/js/lay/modules/jquery.js?v=2.1.4}"></script>
<script type="text/javascript">
    layui.use(['upload', 'element', 'layer'], function () {
        var $ = layui.jquery
            , upload = layui.upload
            , element = layui.element
            , layer = layui.layer;

        upload.render({
            elem: '#choose'
            , url: '/animal/inputs/upload' //此处配置你自己的上传接口即可
            , auto: false
            //,multiple: true
            , exts: 'xls|xlsx' //只允许上传
            , bindAction: '#upload'
            , done: function (res) {
                if (res.code == 0) {
                    parent.layer.msg(res.msg);
                    parent.reLoad();
                    var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                    parent.layer.close(index);

                } else {
                    parent.layer.alert(res.msg)
                }
            }
        });
    });
</script>
</body>
</html>
